﻿using Data.Entities;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Data.AggregateRoot;

namespace Repository.Interface
{
    public interface IRepositoryBase<TEntity> where TEntity : class, IPrimaryKey<Guid>, ISoftDelete
    {
        Task<TEntity> FindAsync(Guid id);
        Task CreateAsync(TEntity entity);
        Task CreateAsync(IList<TEntity> entitys);
        Task UpdateAsync(TEntity entity);
        Task UpdateAsync(IList<TEntity> entityList);
        Task DeleteAsync(Guid id);
        Task DeleteAsync(IList<Guid> ids);
        Task DeleteAsync(IList<TEntity> entities);
        Task<TEntity> FirstAsync(Expression<Func<TEntity, bool>> func);
        Task<IList<TEntity>> FindAsync(Expression<Func<TEntity, bool>> func);
        void SetPhyDelete();
    }
}